#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void xier(int* a, int n)
{
	int gad = n;
	while (gad > 1)
	{
		gad = gad / 3 + 1;
		for (int i = 0; i < n - gad; i++)
		{
			int end = i;
			int tmp = a[end + gad];
			while (end >= 0)
			{
				if (tmp < a[end])
				{
					a[end + gad] = a[end];
					end=end-gad;
				}
				else
				{
					break;
				}
			}
			a[end + gad] = tmp;
		}
	}
}
int main()
{
	int arr[] = { 13,345,7465,9234,3764,6783,5878,897,548 };
	xier(arr, sizeof(arr) / sizeof(arr[0]));
	for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}